package com.lonty.intelligence.mapper;

import com.lonty.intelligence.model.Owner;
import com.lonty.intelligence.request.RoomInfoList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @Author 陈璇
 * @Date 2020/4/17 14:19
 * @Version 1.0
 */
@Mapper
public interface OwnerMapper {

    /**
     * 保存业主
     * @param owner
     * @return
     */
    int saveOwner(Owner owner);

    /**
     * 根据楼栋ID获取业主
     * @param buildingId
     * @return
     */
    Owner getByBuildingId(String buildingId);

    /**
     * 根据手机号获取业主
     * @param telephone
     * @return
     */
    Owner getByTelephone(String telephone);

    /**
     * 根据楼栋ID获取业主信息
     * @param buildingId
     * @return
     */
    RoomInfoList getRoomInfo(String buildingId);

    /**
     * 根据ID修改业主信息
     * @param id
     * @param name
     * @param telephone
     * @param type
     * @return
     */
    int modifyRoomInfo(@Param("id") String id,@Param("name") String name,
                       @Param("telephone") String telephone,@Param("type") String type);

    /**
     * 根据楼栋ID修改业主信息
     * @param buildingId
     * @param name
     * @param telephone
     * @return
     */
    int modifyOwnerInfo(@Param("buildingId") String buildingId,@Param("name") String name,
                        @Param("telephone") String telephone, @Param("isLiving") Integer isLiving);

}
